import React from "react";

export default class List extends React.Component{
    constructor(props){
        super(props);
        console.log(props)
    }
    render(){
        return(
            <div className="list">
            <ul>
                {this.props.todo.data.map((e,i)=>{
                    return e == null ? e : (
                        <li key={i}>
                            <span className="todo-cont">{e.text}</span>
                            <span className="del-todo btn" onClick={this.props.del.bind(this,e.id)}>完成</span>
                        </li>
                    )
                })}
            </ul>
            </div>
        )
    }
}